bin_PROGRAMS=countwords
countwords_SOURCES=src/countwords.c src/lexer.l
VPATH=src

countwords: countwords.o lexer.o -lfl
	gcc countwords.o lexer.o -lfl -o countwords
	doxygen src/countwords.c
countwords.o: countwords.c
	gcc -c src/countwords.c

lexer.o: lexer.c
	gcc -c lexer.c

lexer.c: lexer.l
	flex -t src/lexer.l > lexer.c

make install:
	cp -r html /usr/local/share/doc/countwords
	cp doc/README /usr/local/share/doc/countwords

make uninstall:
	rm /usr/local/bin/countwords
